package com.clusterswisdom.horn.api.tmall.action.item;

import com.alibaba.fastjson.JSONObject;
import com.clusterswisdom.horn.api.ioc.HornAction;
import com.clusterswisdom.horn.api.ioc.HornResponse;
import com.clusterswisdom.horn.api.ioc.api.ApiConfig;
import com.clusterswisdom.horn.api.tmall.TmallInstance;
import com.clusterswisdom.horn.api.tmall.action.AbstractTmallAction;
import com.taobao.api.response.ItemDeleteResponse;


public class DeleteItemAction extends AbstractTmallAction implements HornAction {

	@Override
	public HornResponse execute(ApiConfig config, JSONObject param)
			throws Exception {
		ItemDeleteResponse resp = (ItemDeleteResponse)TmallInstance.getInstance().executeRequest(param, "item", "itemDelete");
		if(resp.isSuccess()) {
			return new HornResponse(true,resp.getItem());
			
		} else {
			return getUnsuccessResponse(resp);
			
		}
	}

}
